package com.zly.demo.rediscache.controller;

import com.zly.demo.rediscache.entity.User;
import com.zly.demo.rediscache.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Resource
    private UserService userService;
    @GetMapping("/user")
    public User getUserById(@RequestParam(value = "id",defaultValue = "1") Long id) {
        return userService.getUserById(id);
    }
}
